Learning Flex Basics (Part 4): Working with Data Models
Table of Contents
- Introduction
- Create the Application Object and Application Layout
- Add the Form Controls and the DataGrid Controls
- Add the New Employee Model, Employee, and Location Models
- Instantiate the DataController Class, and Create the Employee and DataController Classes
- Add the DataController Methods
- Code Listing for data.mxml
- Code Listings for DataController.as and Employee.as
- Code Listings for locations.xml and employee.xml
- Where to Go From Here
Complete Code Listing for employees.xml
Note: This is a prebuilt data file; if you need to build your own copy, copy the data below into an empty text file and save it as employees.xml in the flex_tutorials directory.
<allEmployees> <employee> <fName> Clare </fName> <lName> DuPre </lName> <location> Paris </location> </employee> <employee> <fName> David </fName> <lName> Green </lName> <location> San Francisco </location> </employee> </allEmployees>
Complete Code Listing for locations.xml
Note: this is a pre-built data file; if you need to build your own copy, copy the data below into an empty text file and save it as locations.xml in the flex_tutorials directory.
<locations> <location> Paris </location> <location> Tokyo </location> <location> Cairo </location> <location> San Franscisco </location> </locations>